package br.com.felix.fwt.svg.gradient;

import java.util.ArrayList;
import java.util.List;

import br.com.felix.fwt.svg.SVG;
import br.com.felix.fwt.svg.SVGBuilder;
import br.com.felix.fwt.svg.SVGId;
import br.com.felix.fwt.svg.transform.SVGTransform;

public class SVGLinearGradient implements SVG{

	
	private int x1, y1, x2, y2;
	
	private SVGGradientUnits gradientUnits;
	
	private SVGSpreadMethod spreadMethod;
	
	private SVGTransform gradientTransform;
	
	private String xlinkHref;
	
	private SVGId id;
	
	private List<SVG> stops;
	
	public SVGLinearGradient(){
		stops = new ArrayList<SVG>(); 
	}
	
	public void addStop(SVGStop stop){
		stops.add(stop);
	}

	@Override
	public void toSVG(SVGBuilder svgBuilder) {
		svgBuilder.createElement("linearGradient")
			.id(id)
			.attribute("spreadMethod", spreadMethod)
			.percentileAttribute("x1", x1)
			.percentileAttribute("y1", y1)
			.percentileAttribute("x2", x2)
			.percentileAttribute("y2", y2)
			.bodyWithChildren(stops)
			.endElement();
	}
	
	
	
}
